﻿@model DealKhuyenMaiV2.com.Models.Product
@{
    ViewBag.Title = Model.NameProduct;
    Layout = "~/Views/Shared/_MemberGuestLayout.cshtml";
}
<!DOCTYPE html>
<html >
<head>
    

    <link href="@Url.Content("/Content/DefaultThemes/Styles/MemberGuestLayoutStyle.css")" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery.unobtrusive-ajax.min.js" type="text/javascript"></script>
    <style>
        /* TABLE
----------------------------------------------------------*/
        
        .list {
            position: relative;
            border-collapse: collapse;
            width: 600px;
            border-top: 1px solid #DDDDDD;
            border-left: 1px solid #DDDDDD;
            margin-bottom: 20px;
            
        }
        
        .list td
        {
            padding: 20px;
            border: solid 1px #e8eef4;
            vertical-align: top;
            border-spacing: 50px;
        }
        
        .list th
        {
            padding: 6px 5px;
            text-align: left;
            background-color: #e8eef4;
            border: solid 1px #e8eef4;
        }
    </style>
     <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=AIzaSyBJYUiP0GUFitcMboSth7nDK61S8IiZyz0" type="text/javascript"></script>
    <script src="../../Scripts/gMap.js" type="text/javascript"></script>
    <script type = "text/javascript">
        
        $(document).ready(function () {
            initialize("map_canvas", '@Model.Account.AddressReceive', @Model.Account.Latitude, @Model.Account.Longitude);
        });
   </script>
   <div id="fb-root"></div>
<script>    (function (d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s); js.id = id;
        js.src = "//connect.facebook.net/vi_VN/all.js#xfbml=1&appId=361148687280051";
        fjs.parentNode.insertBefore(js, fjs);
    } (document, 'script', 'facebook-jssdk'));</script>
</head>
<body>

    <div class="col_left">
        <!-------Begin Box Deal lon---------->
        
        <div class="box_deal_lon">
            <div class="title_deal_lon">
                <h1>
                
                    @Model.NameProduct
                    
                </h1>
            </div>
            <!-- Nho them the h1 vao day -->
            <div id="deal_info_lon">
                <div id="arrow_lon">
                    <div class="gia_deal_lon">
                        @(Model.Price - Model.Discount)đ
                    </div>
                    <div class="button_lon">
                        <input type="button" class="btn_mua_lon" onclick="location.href='@Url.Action("ShoppingCart", "Home", new { idProduct = Model.IDProduct })'"/>
                    </div>
                </div>
                <div id="tem_lon">
                    <div class="text_giam">
                        GIẢM</div>
                    <div class="phantram_lon">
                        @Math.Round(Model.Discount * 100 / Model.Price)%
                    </div>
                </div>
                <div class="gia_goc_lon">
                    Giá gốc<br/>
                           @(Model.Price)đ
                </div>
                <div class="tiet_kiem_lon">
                    Tiết kiệm<br/>
                             @(Model.Discount)đ
                </div>
                <div class="wrap_clock">
                    <strong>Thời gian khuyến mãi đến</strong>
                    <div class="box_clock_day">
                        <div class="hour" style="width: 54px;">
                            @Model.Date_end.Day.ToString("00")</div>
                        <div class="hour" style="width: 58px;">
                            @Model.Date_end.Month.ToString("00")</div>
                        <div class="hour" style="width: 85px;">
                            @Model.Date_end.Year</div>
                           
                            
                            
                    </div>
                </div>
                <div class="box_luotmua_lon">
                    Đã có <span class="phieudamua">@Model.NumberOfPurchased</span> lượt mua<br/>
                    <span class="phieuconlai">Còn lại @(Model.TotalOfNumber - Model.NumberOfPurchased) cơ hội</span>
                </div>
            </div>
            <div id="img_deal_lon">
                @{Html.RenderPartial("_PartialSildeShow");}
            </div>
            <div style="height: 5px; clear: both;">
            </div>
              <a href="http://www.facebook.com/sharer.php?u=@Request.Url"
            style="border: 0pt none; margin: 0pt" target="_blank" title="Facebook">
            <img alt="http://tuoitre.vn/Images/bookmark/facebook_48.png" src="http://tuoitre.vn/Images/bookmark/facebook_48.png"
                style="margin: 0px; border: 0px; width: 20px; margin-left: 5px"></a>
            <div class="fb-like" data-href="@Request.Url"
                data-send="true" data-layout="button_count" data-width="450" data-show-faces="false">
            </div>
        </div>
        <!-------END Box Deal lon---------->

       <!-- Begin điều kiện -->
        <div class="box_deal_lon">
            <table class = "list">
            
                <tr>
                    
                    <td style="width: 50%;">
                        <strong>Điểm nổi bật</strong><br />
                        @Html.Raw(Model.Summary)
                    </td>
                    <td>
                         <strong>Điều kiện</strong><br />
                        @Html.Raw(Model.Condition)
                    </td>
                </tr>
            </table>
           
        </div>
        <!-- End box diều kiện -->
        
   
        
        <!-- Begin thông tin doanh nghiệp -->
        <div class="box_deal_lon">
                <strong>Thông tin doanh nghiệp</strong>
                <p style="color: red;">
                    <strong>@Model.Account.FullName</strong></p>
                       
                <p>
                    Email: @Model.Account.Email<br />
                    Số điện thoại: @Model.Account.PhoneNumber<br />
                    Địa chỉ: @Model.Account.AddressReceive
                </p>            
        </div>
        <div class="box_deal_lon">
              @Html.Raw(Model.Description)            
        </div>
        <div class="box_deal_lon">
        <div id="map_canvas" style="width: 100%; height: 400px"></div>     
    </div>
        

            <!-- Begin box Binh Luan -->
        <div class="box_deal_lon bgCom">
            <a name="Comment125"></a>
            @if (Request.IsAuthenticated)
            {
                 
                <div class="Write">
                    <h2>
                        Thêm thảo luận của bạn</h2>
                    <div class="BoxWriteCom">
                        <div style="padding: 3px;" class="AvataCom">
                            <img alt="" src="/Content/DefaultThemes/Images/avatar-off.png">
                        </div>
                        @using (Ajax.BeginForm("PostComment", "Home", new AjaxOptions
                        {
                            HttpMethod = "POST",
                            UpdateTargetId = "listComment",
                            InsertionMode = InsertionMode.Replace
                        }))
                        {
                            <input type = "hidden" value = "@Model.IDProduct" name = "IDProduct"></input>
                            @Html.TextArea("textarea", new { @rows = "5", @class = "pleasewrite", @cols = "45" })                     
                            <input type="submit" value="Gửi" class="SendCom" />
                        }
                    </div>
                </div>
            }
            else
            { 
                <h2>
                    Hãy 
                    <a href = "@Url.Action("Logon", "Account")">Đăng Nhập</a> để Được bình luận sản phẩm.
                </h2>
            }
            <div id="listComment">
                @{Html.RenderPartial("_ListComment", Model.Comments.Reverse<DealKhuyenMaiV2.com.Models.Comment>().ToList());}
            </div>
        </div>
        <!-- End box Binh Luan -->
           
    </div> 
</body>
</html>
